home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CDsupport / IDer / Routines / Cleanup.s < prev    next >
Text File  |  1997-02-18  |  818b  |  23 lines

  1. Cleanup:    Move.L    _FileHandle(PC),D1
  2.     Tst.L    D1
  3.     Beq.S    .NoDOS
  4.     CALL    Close,DOS
  5.     Clr.L    _FileHandle
  6. .NoDOS
  7.     Move.L    _OutputBuffer(PC),A1    ;clean up the memory allocated to hold
  8.     Move.L    _OutputBufLen(PC),D0    ;the data file so the user actually has
  9.     Cmp.L    #0,A1        ;some memory to work with when they try
  10.     Beq.S    .NoFileMemory        ;to view the file
  11.     CALL    FreeMem,EXEC
  12. .NoFileMemory
  13.     Clr.L    _OutputBuffer        ;these lines clear the various data
  14.     Clr.L    _OutputBufLen        ;containers that may have values
  15.     Clr.L    _OutputLength        ;that could interfer with the successful
  16.     Clr.L    _FilePart        ;operation of the IDer if it is run
  17.     Clr.W    _ErrorCode        ;to view more than one file.
  18.     Clr.B    FileName        ;therefore, we must clear all these
  19.     Move.L    _ConfigMem(PC),_ConfigCurPos    ;before we can try to run another file
  20.     Clr.L    _Mode
  21.     Move.L    #FileData,_FileData
  22.     Rts
  23.